package com.pclong.sql;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 读取properties配置文件的工具类
 */
public class PropertiesHelper {
	
	public static String getProperty(String fileName, String key) {
		String value = "";
		InputStream in = null;
		try {
			in = PropertiesHelper.class.getResourceAsStream("/" + fileName);
			Properties properties = new Properties();
			properties.load(in);
			value = properties.getProperty(key);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				in.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		
		return value;
	}
	
	
	
}
